<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--输出hello数据-->
<p th:text="${hello}"></p>
<br/>
<!--form表单-->
<form th:action="@{/thymeleaf/hello}" >
    <input th:type="text"  th:name="id">
    <button>提交</button>
</form>
<br/>
<!--th:each遍历-->
<table>
    <tr>
        <td>下标</td>
        <td>编号</td>
        <td>姓名</td>
        <td>住址</td>
    </tr>
    <tr th:each="user,userstate:${users}">
        <td th:text="${userstate.index}"></td>
        <td th:text="${user.id}"></td>
        <td th:text="${user.name}"></td>
        <td th:text="${user.address}"></td>
    </tr>
</table>
<!--
	注意:th:each表示循环遍历，user表示users集合的泛型名称，userstate表示别名
	userstate.index表示获取下标从0开始
-->
<br/>
<!--map输出遍历-->
    <div th:each="map,mapstate:${dataMap}">
    <!--获取map中的k=v-->
    <div th:text="${map}"></div>
    key:<span th:text="${mapstate.current.key}"></span><br>
    value:<span th:text="${mapstate.current.value}"></span><br>
    </div>
<br/>
    <!--数组输出-->
    <div th:each="name,namestate:${names}">
        序号:<span th:text="${namestate.count}"></span>
        姓名:<span th:text="${name}"></span>
    </div>
<br/>
    <!--日期输出-->
    <div>
        <!--默认时间格式-->
        <span th:text="${now}"></span>
<br/>
        <!--转化日期格式-->
        <span th:text="${#dates.format(now,'yyyy-MM-dd hh:mm:ss')}"></span>
    </div>
<br/>
    <!--if判断-->
    <div>
        <span th:if="${age>20}" th:text="你终于长大了"></span>
    </div>
<br/>
<!--引入模块-->
<div th:include="foot::copy"></div>
</body>
</html>